import request from '@/utils/request'

// 创建溯源信息
export function createReview(data) {
  return request({
    url: '/agro/review/create',
    method: 'post',
    data: data
  })
}

// 更新溯源信息
export function updateReview(data) {
  return request({
    url: '/agro/review/update',
    method: 'put',
    data: data
  })
}

// 删除溯源信息
export function deleteReview(id) {
  return request({
    url: '/agro/review/delete?id=' + id,
    method: 'delete'
  })
}

// 获得溯源信息
export function getReview(id) {
  return request({
    url: '/agro/review/get?id=' + id,
    method: 'get'
  })
}

// 获得溯源信息分页
export function getReviewPage(query) {
  return request({
    url: '/agro/review/page',
    method: 'get',
    params: query
  })
}

// 导出溯源信息 Excel
export function exportReviewExcel(query) {
  return request({
    url: '/agro/review/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
